import request from "@/utils/request.js"

/**
 * 获取任务列表
 * @param {Object} data
 */
export function getMission(data) {
	return request({
		url: "/app/task/list",
		method: "GET",
		params: data
	})
}

/**
 * 获取任务详情
 * @param {Object} data
 */
export function getMissionDetail(id) {
	return request({
		url: "/business/task/" + id,
		method: "GET",
		standard: true
	})
}

/**
 * 设置任务状态
 */
export function setMissionStatus(data) {
	return request({
		url: "/app/task/update",
		method: "POST",
		params: data,
		standard: true
	})
}

/**
 * 获取打卡学校坐标
 */
export function getSchoolLocation(id) {
	return request({
		url: "/app/task/school/longlat/" + id,
		method: "GET",
		standard: true
	})
}

/**
 * 获取任务日志
 */
export function getMissionRecord(id) {
	return request({
		url: "/business/task/" + id,
		method: "GET",
		standard: true
	})
}

/**
 * 上传材料
 */

export function addRecord(data) {
	return request({
		url: "/app/task/addRecord",
		method: "POST",
		params: data
	})
}

/**
 * 修改日志状态
 */
export function updateRecordStatus(id) {
	return request({
		url: "/app/task/confirmRecord/" + id,
		method: "POST"
	})
}


/**
 * 生成督导报告
 */
export function createReport(data) {
	return request({
		url: "/app/report/generate",
		method: "POST",
		params: data
	})
}

/**
 * 查看生成的督导报告
 */
export function getReport(id) {
	return request({
		url: "/app/report/task/" + id,
		method: "GET",
		standard: true
	})
}


/**
 * 查看上传的督导报告
 */
export function getSubmitReport(id) {
	return request({
		url: "/app/report/task/commit/" + id,
		method: "GET",
		standard: true
	})
}

/**
 * 根据报告ID查询报告详情
 */
export function getAIReport(id) {
	return request({
		url: "/app/report/" + id,
		method: "GET",
		standard: true
	})
}

/**
 * 查询当前进行中的任务且今日未打卡的任务学校信息
 */
export function getWFLocaleSchools(id) {
	return request({
		url: "/app/task/lonlats",
		method: "GET",
		standard: true
	})
}

/**
 * 任务打卡
 */
export function clockin(id) {
	return request({
		url: "/app/task/addPunchCardLog/" + id,
		method: "POST",
	})
}

export function getForm(data) {
	return request({
		url: "/app/form/details",
		method: "GET",
		params: data,
		standard: true
	})
}

export function updateForm(data) {
	return request({
		url: "/app/form/update",
		method: "POST",
		params: data
	})
}


/**
 * 提交表单
 */
export function submitForm(data) {
	return request({
		url: "/app/form/commit",
		method: "POST",
		params: data
	})
}

/**
 * 提交报告
 */
export function submitReport(data) {
	return request({
		url: "/app/report/upload",
		method: "POST",
		params: data
	})
}

export function getMissionList(data) {
	return request({
		url: "/app/task/list",
		method: "GET",
		params: data
	})
}

/**
 * 查询组织树状结构
 */
export function queryGroupTree() {
	return request({
		url: "/app/common/organizaTree",
		method: "GET",
		standard: true
	})
}

/**
 * 根据组织ID查询任务列表
 */
export function queryMissionByGroup(data) {
	return request({
		url: "/app/task/organiza",
		method: "GET",
		params: data
	})
}

export function queryFormStatistics(data) {
	return request({
		url: "/app/form/statistics",
		method: "GET",
		params: data,
		standard: true
	})
}

export function queryRectbyTaskRecordId(data) {
	return request({
		url: "/app/rectification/overall/byTaskRecordId/" + data.record_id,
		method: "GET",
		standard: true
	})
}



export function queryRectbyRectRecordId(data) {
	return request({
		url: "/app/rectification/overall/byRectificationTaskRecordId/" + data.record_id,
		method: "GET",
		standard: true
	})
}

export function addRect(data) {
	return request({
		url: "/app/rectification/add",
		method: "POST",
		params: data,
		// standard: true
	})
}


export function uploadRect(data) {
	return request({
		url: "/app/rectification/upload",
		method: "POST",
		params: data,
		// standard: true
	})
}


export function rectAudit(data) {
	return request({
		url: "/app/rectification/audit",
		method: "POST",
		params: data,
	})
}

export function queryFormList(data) {
	return request({
		url: "/app/form/list",
		method: "GET",
		params: data
	})
}